#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <aclconio.h>
#include <define.h>
#include <transact.h>
#include <tran.h>
#include <gds.h>
#include <sizes.h>
#include <\SOFTPAY\Ver30\source\include\sizes.h>
#include <\SOFTPAY\Ver30\HostSrc\citisrc\citiids.h>
#include <\SOFTPAY\Ver30\HostSrc\cpacsrc\cpacids.h>
#include <confio.h>

#include <\SOFTPAY\Ver30\source\include\MNU.h>

const char*MNUName = "MNU.dat";

static MNU_REC srMNURec;

static int recordNum;
int	inLoadMNURec (int inRecNumber)
{
	int inRet;

	inRet = inLoadConfRec(MNU_FILENAME, SIZE_MNU_REC, inRecNumber, (char *) &srMNURec);

	recordNum = inRecNumber;
	return inRet;
}

void *pvdGetMNURec(void)
{
	return &srMNURec;

}

int	inSaveMNURec (int inRecNumber)
{
	int inRet;

	inRet = inSaveConfRec(MNU_FILENAME, SIZE_MNU_REC, inRecNumber, (char *) &srMNURec);

	return inRet;
}

int	inGetMNURecNumber (void)
{
	return recordNum;
}

int	inUpdateMNURec (void)
{
	int inRet;

	inRet = inSaveConfRec(MNU_FILENAME, SIZE_MNU_REC, recordNum, (char *) &srMNURec);

	return inRet;
}

void	vdResetMNURec (void)
{
	memset((void*)&srMNURec, 0, REC_SIZEOF(srMNURec));
}

short inGetMNUMenuIndex(void)
{
	return srMNURec.inMNUMenuIndex;
}

void vdSetMNUMenuIndex(short inMNUMenuIndex)
{
	srMNURec.inMNUMenuIndex = inMNUMenuIndex;
}

char* szGetMNUMenuName(void)
{
	return srMNURec.szMNUMenuName;
}

void vdSetMNUMenuName(const char* szMNUMenuName)
{
	strNumCopy(srMNURec.szMNUMenuName, szMNUMenuName, sizeof(((MNU_REC*)NULL)->szMNUMenuName)-1);
}

short inGetMNUActionCode(void)
{
	return srMNURec.inMNUActionCode;
}

void vdSetMNUActionCode(short inMNUActionCode)
{
	srMNURec.inMNUActionCode = inMNUActionCode;
}

short inGetMNUBitmapID(void)
{
	return srMNURec.inMNUBitmapID;
}

void vdSetMNUBitmapID(short inMNUBitmapID)
{
	srMNURec.inMNUBitmapID = inMNUBitmapID;
}

short inGetMNUFooterID(void)
{
	return srMNURec.inMNUFooterID;
}

void vdSetMNUFooterID(short inMNUFooterID)
{
	srMNURec.inMNUFooterID = inMNUFooterID;
}

short inGetMNUDataID(void)
{
	return srMNURec.inMNUDataID;
}

void vdSetMNUDataID(short inMNUDataID)
{
	srMNURec.inMNUDataID = inMNUDataID;
}

short inGetMNUPasswordLevel(void)
{
	return srMNURec.inMNUPasswordLevel;
}

void vdSetMNUPasswordLevel(short inMNUPasswordLevel)
{
	srMNURec.inMNUPasswordLevel = inMNUPasswordLevel;
}

